import request from '@/utils/request'

/**
 * 登录
 * @param username
 * @param password
 */
export function login(username, password) {
  return request({
    url: '/user/login',
    method: 'post',
    data: {
      username,
      password
    }
  })
}

/**
 * 获取角色拥有的权限
 * @param roleId
 */
export function getRolePermission(roleId) {
  return request({
    url: '/role/getRolePermission',
    method: 'post',
    data: {
      roleId
    }
  })
}

/**
 * 退出登录
 */
export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
